home *** CD-ROM | disk | FTP | other *** search
/ PC Home 48 / Fun Clicp Art 5000.iso / r / mbm / 00691_MTR gest.ls < prev    next >
Encoding:
Text File  |  1996-05-11  |  6.6 KB  |  240 lines

  1. on BigPurge
  2.   if the freeBlock < 3000 then
  3.     unLoadCast()
  4.   else
  5.   end if
  6. end
  7.  
  8. on JukeBox maliste, le_act
  9.   global gListZic0, gListZic1, gIndZic1, gIndZic0, gVolZic
  10.   if soundBusy(1) = 0 then
  11.     if le_act = " " then
  12.       if maliste = 0 then
  13.         set maZic to getAt(gListZic0, gIndZic0)
  14.         set gIndZic0 to gIndZic0 + 1
  15.         if gIndZic0 > count(gListZic0) then
  16.           set gIndZic0 to 1
  17.         end if
  18.       else
  19.         set maZic to getAt(gListZic1, gIndZic1)
  20.         set gIndZic1 to gIndZic1 + 1
  21.         if gIndZic1 > count(gListZic1) then
  22.           set gIndZic1 to 1
  23.         end if
  24.       end if
  25.     else
  26.       set maZic to le_act
  27.     end if
  28.     preLoadCast(maZic)
  29.     puppetSound(maZic)
  30.     set the volume of sound 1 to gVolZic
  31.   end if
  32. end
  33.  
  34. on keyDown
  35.   global gVolZic, gVolVid, gScopeDe, gScopeHi, gScopeCi, gChapAct, gEtudAct, gScopeEnB, gListDepth, gScopeCh
  36.   if the keyCode = 116 then
  37.     if gVolZic < 245 then
  38.       set gVolZic to gVolZic + 10
  39.       set the volume of sound 1 to gVolZic
  40.     end if
  41.   else
  42.     if the keyCode = 121 then
  43.       if gVolZic > 10 then
  44.         set gVolZic to gVolZic - 10
  45.         set the volume of sound 1 to gVolZic
  46.       end if
  47.     else
  48.       if (the keyCode = 115) or (the keyCode = 119) then
  49.         set monScope to 0
  50.         if gChapAct = "CI" then
  51.           set monScope to gScopeCi
  52.         else
  53.           if (gChapAct = "DE") and (gEtudAct = "lec") then
  54.             set monScope to gScopeDe
  55.           else
  56.             if (gChapAct = "SU") and (gEtudAct = "hi") then
  57.               set monScope to gScopeHi
  58.             else
  59.               if (gChapAct = "SU") and (gEtudAct = "en") then
  60.                 set monScope to gScopeEnB
  61.               else
  62.                 if gChapAct = "CH" then
  63.                   set monScope to gScopeCh
  64.                 else
  65.                   set monScope to 0
  66.                 end if
  67.               end if
  68.             end if
  69.           end if
  70.         end if
  71.         if monScope <> 0 then
  72.           if the keyCode = 115 then
  73.             if gVolVid < 245 then
  74.               set gVolVid to gVolVid + 10
  75.               monScope(VolAbs)
  76.             end if
  77.           else
  78.             if the keyCode = 119 then
  79.               if gVolVid > 10 then
  80.                 set gVolVid to gVolVid - 10
  81.                 monScope(VolAbs)
  82.               end if
  83.             end if
  84.           end if
  85.         end if
  86.       else
  87.         if (the commandDown = 1) and (the keyCode = 48) then
  88.           set maPos to getPos(gListDepth, the colorDepth)
  89.           if maPos = 3 then
  90.             set maPos to 1
  91.           else
  92.             set maPos to maPos + 1
  93.           end if
  94.           set the colorDepth to getAt(gListDepth, maPos)
  95.           if the colorDepth <> getAt(gListDepth, maPos) then
  96.             set maPos to 1
  97.             set the colorDepth to getAt(gListDepth, maPos)
  98.           end if
  99.           alert(getAt(gTraduit, 113) && getAt(gTraduit, 113 + maPos))
  100.         else
  101.           if (the commandDown = 1) and (the key = "q") then
  102.             beep()
  103.           else
  104.             pass()
  105.           end if
  106.         end if
  107.       end if
  108.     end if
  109.   end if
  110. end
  111.  
  112. on mouseDown
  113.   global gNumSpr, gBoutons, gSurvolPrec
  114.   set gNumSpr to 0
  115.   set gSurvolPrec to -1
  116. end
  117.  
  118. on mouseUp
  119.   global gBoutons, gSurvolPrec, gEtaSpir, gIndSel, gNumSpr, g1erSprLoc, gOldSelStart, gOldSelEnd
  120.   if gNumSpr = 999 then
  121.     nothing()
  122.   else
  123.     if (gNumSpr > 0) and (gEtaSpir = 0) then
  124.       if the castNum of sprite gNumSpr <> 0 then
  125.         gBoutons(relache, gNumSpr)
  126.       end if
  127.     end if
  128.     set gSurvolPrec to -1
  129.   end if
  130.   curseur(-1)
  131. end
  132.  
  133. on SetBoxEnv
  134.   global gNumEnv, gNomBestEnv, gBotBestEnv, gTopBestEnv, gLefBestEnv
  135.   repeat with i = 1 to 4
  136.     spriteBox(29 + i, getAt(gLefBestEnv, getAt(gNumEnv, i)), getAt(gTopBestEnv, getAt(gNumEnv, i)), getAt(gRigBestEnv, getAt(gNumEnv, i)), getAt(gBotBestEnv, getAt(gNumEnv, i)))
  137.   end repeat
  138. end
  139.  
  140. on setEnv Le_Code, mode
  141.   global gIndEnv, gEnv1, gEnv2, gEnv3, gEnv4, gCodEnv, gNumEnv, gNomBestEnv, gBotBestEnv, gTopBestEnv, gLefBestEnv, gRigBestEnv, gTextEnvT, gTextEnvL
  142.   curseur(6)
  143.   set monInd to getPos(gIndEnv, Le_Code)
  144.   if monInd = 0 then
  145.     alert("Bug : setEnv, le_code = >" & Le_Code & "<")
  146.   else
  147.     set gCodEnv to list(getAt(gEnv1, monInd), getAt(gEnv2, monInd), getAt(gEnv3, monInd), getAt(gEnv4, monInd))
  148.     set gNumEnv to []
  149.     repeat with i = 1 to 4
  150.       add(gNumEnv, ((monInd - 1) * 4) + i)
  151.     end repeat
  152.     if mode = 1 then
  153.       SetBoxEnv()
  154.     end if
  155.     set gTextEnvL to []
  156.     set i to 1
  157.     set j to 1
  158.     repeat while j < 5
  159.       set codTemp to "@" & getAt(gCodEnv, j)
  160.       if char 2 of codTemp = " " then
  161.         addAt(gTextEnvL, j, " ")
  162.       else
  163.         repeat while (line i of gTextEnvT starts codTemp) <> 1
  164.           set i to i + 1
  165.         end repeat
  166.         set ligne to chars(line i of gTextEnvT, 5, the number of chars in line i of gTextEnvT)
  167.         add(gTextEnvL, ligne)
  168.         set i to i + 1
  169.         if char 1 of line i of gTextEnvT <> "@" then
  170.           setAt(gTextEnvL, j, getAt(gTextEnvL, j) & RETURN & line i of gTextEnvT)
  171.           set i to i + 1
  172.         end if
  173.       end if
  174.       set j to j + 1
  175.     end repeat
  176.   end if
  177. end
  178.  
  179. on Affiche_Date le_suj, le_acttxt1, le_acttxt2, le_acttxt3, le_fleche
  180.   global gTraduit, gBarChron
  181.   set monNomSuj to le_suj(Le_Nom)
  182.   set monEpok to le_suj(Le_Epoque)
  183.   if monEpok > 50 then
  184.     set txt2 to getAt(gTraduit, 20)
  185.   else
  186.     if monEpok > 30 then
  187.       set txt2 to getAt(gTraduit, 21)
  188.     else
  189.       if monEpok > 17 then
  190.         set txt2 to getAt(gTraduit, 22)
  191.       else
  192.         if monEpok > 4 then
  193.           set txt2 to getAt(gTraduit, 23)
  194.         else
  195.           if monEpok > 1 then
  196.             set txt2 to getAt(gTraduit, 24)
  197.           else
  198.             set txt2 to getAt(gTraduit, 25)
  199.           end if
  200.         end if
  201.       end if
  202.     end if
  203.   end if
  204.   if monEpok > 1 then
  205.     set txt1 to monEpok && getAt(gTraduit, 17)
  206.   else
  207.     if monEpok = 1 then
  208.       set txt1 to getAt(gTraduit, 18)
  209.     else
  210.       if monEpok = 0.20000000000000001 then
  211.         set txt1 to "200 " & getAt(gTraduit, 19)
  212.       else
  213.         set txt1 to "35 " & getAt(gTraduit, 19)
  214.       end if
  215.     end if
  216.   end if
  217.   set the text of cast le_acttxt1 to txt1
  218.   set the text of cast le_acttxt2 to txt2
  219.   set the textStyle of cast le_acttxt3 to "bold,italic"
  220.   set the text of cast le_acttxt3 to monNomSuj
  221.   gBarChron(fleche, 1, monEpok, le_fleche)
  222. end
  223.  
  224. on curseur numCurs
  225.   global gCursor, gCurPrec
  226.   if numCurs <> gCursor then
  227.     if numCurs <> -1 then
  228.       if (gCursor <> 6) and (numCurs <> gCursor) then
  229.         set gCurPrec to gCursor
  230.         set gCursor to numCurs
  231.         cursor([getAt(gListCurs, gCursor), getAt(gListMsk, gCursor)])
  232.       end if
  233.     else
  234.       set gCurPrec to gCursor
  235.       set gCursor to numCurs
  236.       cursor(numCurs)
  237.     end if
  238.   end if
  239. end
  240.